<template>
<div>
 <div class="crumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>
          <i class="el-icon-lx-cascades"></i> 用户列表
        </el-breadcrumb-item>
      </el-breadcrumb>
      <!-- https://blog.csdn.net/sym_sqc123/article/details/106801831
      https://www.jianshu.com/p/6d5c3f728bcf 文件表单https://blog.csdn.net/qq_42394457/article/details/96769170
       -->
      <!--https://blog.csdn.net/weixin_30439067/article/details/95721811-->
      <!-- 上传文件加表单：https://www.cnblogs.com/y-zz/p/12510983.html   https://www.cnblogs.com/wenqiangit/p/10538871.html-->
    </div>

<div class="container">
  <el-upload
  class="upload-demo"
  action="https://jsonplaceholder.typicode.com/posts/"
  
  :file-list="fileList"

  list-type="picture">
  <el-button size="small" type="primary">点击上传</el-button>
 <!--  eslint-disable-next-line --> <!--https://blog.csdn.net/HanXiaoXi_yeal/article/details/115365751-->
  <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
</el-upload>
</div>
</div>
  
</template>
<script>
import { provelist } from "../api/other";

  export default {
    data() {
      return {
        fileList: [
           // {
                
        // prove_id: "",
        // activity_id: "",
        // url: "",
        // prove_description: "华南理工大学广州学院经济学院第七届班级辩论赛揭幕赛加分证明特此证明加德育分一分",
        // topic: "华南理工大学广州学院经济学院第七届班级辩论赛揭幕赛加分证明",
            //  }, 
           ]
      
      };

    },
    methods: {
    //   handleRemove(file, fileList) {
    //     console.log(file, fileList);
    //   },

    //   handlePreview(file) {
    //     console.log(file);
    //   },
      getData(){
          provelist().then(res=>{
              console.log(res)
                      //this.fileList.url= res.data.list.prove_url;
                    //   this.fileList.activity_id = res.data.list.activity_id;
                    //   this.fileList.prove_url = res.data.list.prove_url;
                    //   this.fileList.prove_description = res.data.list.prove_description;
                    //   this.fileList.topic = res.data.list.topic;
                     const list = res.data.list
                    const temp = list
                    console.log(temp)
                    for (let i = 0; i < temp.length; i++) {
                    const b = temp[i].prove_url
                    const c =temp[i].prove_id
                   
                    this.fileList.push({id:c,url:b})
                    }

          })
      }


    },
    created(){
        this.getData();
    }
  }
</script>

